package com.heima.kafka.listen;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class MessageListener {

    @KafkaListener(topics = "itcast-topic")
    public void handleMsg(ConsumerRecord<String,String> record){
        System.out.println("消息的key =>"+record.key());
        System.out.println("消息的value=>"+record.value());

    }
}
